package org.hilo.boot.mybatis;

import org.apache.maven.plugins.annotations.Mojo;

import com.baomidou.mybatisplus.generator.AutoGenerator;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;

/**
 * 生成文件
 * 
 * @author zollty
 * @since 2018-3-16
 */
@Mojo(name = "code", threadSafe = true)
public class GenerateMojo extends AbstractGenerateMojo {

	public void execute() {
		log.info("准备生成文件..........................");
		AutoGenerator mpg = new AutoGenerator();
		initConfig();
		mpg.setConfig(config);
		mpg.setTemplateEngine(new FreemarkerTemplateEngine());
		mpg.execute();
		log.info("文件生成完成！！！..........................");
	}

}
